Skip to content

Conversation

@nghialv
Copy link
Member

@nghialv nghialv commented Jul 2, 2021

What this PR does / why we need it:

This PR updates the builder of planpreview package to be able to find the list of applications that should be triggered.
And in order to reuse code from the trigger package, this also refactors trigger package by moving the part used to decide triggered applications into an independent struct.

Which issue(s) this PR fixes:

Fixes #2145

Does this PR introduce a user-facing change?:

NONE

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.45%. This pull request decreases coverage by -0.13%.

File Function Base Head Diff
pkg/app/piped/planpreview/builder.go builder.plan -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.Get -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.Put -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.getLastTriggeredDeployment -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go NewDeterminer -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go Determiner.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go isTouchedByChangedFiles -- 91.67% +91.67%
pkg/app/piped/trigger/trigger.go Trigger.GetLastTriggeredCommitGetter -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommands -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits -- 0.00% +0.00%
pkg/model/planpreview.go MakeApplicationPlanPreviewResult -- 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.Build 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go NewTrigger 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCommand 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCommit 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkApplication 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.getMostRecentlyTriggeredDeployment 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go isTouchedByChangedFiles 91.67% -- -91.67%

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Implement planpreview plan.

https://github.com/pipe-cd/pipe/blob/c9d359d35dbc6de60f1efd16a20e44b6706814eb/pkg/app/piped/planpreview/builder.go#L142-L145

This was created by todo plugin since "TODO:" was found in c9d359d when #2165 was merged. cc: @nghialv.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.44%. This pull request decreases coverage by -0.13%.

File Function Base Head Diff
pkg/app/piped/planpreview/builder.go builder.plan -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.Get -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.Put -- 0.00% +0.00%
pkg/app/piped/trigger/cache.go lastTriggeredCommitStore.getLastTriggeredDeployment -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go NewDeterminer -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go Determiner.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go isTouchedByChangedFiles -- 91.67% +91.67%
pkg/app/piped/trigger/trigger.go Trigger.GetLastTriggeredCommitGetter -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommands -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits -- 0.00% +0.00%
pkg/model/planpreview.go MakeApplicationPlanPreviewResult -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go NewTrigger 0.00% 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.Build 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCommand 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCommit 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkApplication 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.getMostRecentlyTriggeredDeployment 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go isTouchedByChangedFiles 91.67% -- -91.67%

@nakabonne
Copy link
Member

Great job
/lgtm

@pipecd-bot pipecd-bot added the lgtm label Jul 2, 2021
@khanhtc1202
Copy link
Member

🚀
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit b4cabf8 into master Jul 2, 2021
@pipecd-bot pipecd-bot deleted the plan-preview branch July 2, 2021 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement planpreview builder.

5 participants